{include file="public/header"}
<body>
	<div class="sectionY">
		<a href="javascript:history.back();">
			<img src="__PUBLIC__/home/images/a19.png" alt="" class="a1">
		</a>
		<p class="p1">订单评价</p>
	</div>
	<div class="kong1" style=""></div>
	<div class="fab_section1">
		<form action="">
			<div class="f1">
				<textarea name="" id="comment" cols="30" rows="10" placeholder="评价有惊喜，赶快写下你对该商品的评价吧！"></textarea>
			</div>
			<div class="ge"></div>
			<div class="f2 clearfix">
				<p class="p1">
					<img src="__PUBLIC__/home/images/a73.png" alt="">
					<span class="s1">商品评分</span>
				</p>
				<p class="p2">满意请给5星哦</p>
			</div>
			<div class="f3" id="fa_all">
				<span class="fa fa-star select" data_num="1"></span>
				<span class="fa fa-star " data_num="0"></span>
				<span class="fa fa-star " data_num="0"></span>
				<span class="fa fa-star " data_num="0"></span>
				<span class="fa fa-star" data_num="0"></span>
			</div>
			<div class="sub">
				<input type="button" onclick="comment1('{$order_id}')" value="评价">
			</div>
		</form>
	</div>
</body>
<script>
	$(function(){
		$("#fa_all span").click(function(){
			var dd = $(this).attr("data_num");
			if (dd==0) {
				$(this).attr("data_num","1");
				$(this).prevAll().attr("data_num","1");
				$(this).addClass("select").prevAll().addClass("select")
			}else{
				$(this).attr("data_num","0");
				$(this).nextAll().attr("data_num","0");
				$(this).removeClass("select").nextAll().removeClass("select")
			}
		})
	})
	
	function comment1(order_id) {
		let comment = $.trim($("#comment").val());
		if(comment == ""){
			modal.msg("评论内容不能为空");
			return ;
		}
		let star = $("#fa_all").find(".select").length;
		$.post("{:url('comment')}", {order_id:order_id, star:star, comment:comment}, function (res) {
			modal.msg(res.result_info);
			if(res.result_code == 0){
				history.back();
			}
		})
		
	}
</script>

</html>